using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlTypes;
using System.Web.UI.WebControls;

namespace NET.Library.Web.Forms
{
    /// <summary>
    /// NullValues object.
    /// </summary>
    public class NullValues
    {
        /// '-----------------------------------------------------------------------------------------
        /// 'Returns integer value from DropDownList selected value in a web form.
        /// '-----------------------------------------------------------------------------------------
        public static  SqlInt32 intDropDownListValue(DropDownList DropDownList)
        {
            int? val = null;
            if (DropDownList.SelectedItem != null)
            {
                val = Convert.ToInt32(DropDownList.SelectedItem.Value);
            }

            return (SqlInt32)val;
            //return DropDownList.SelectedItem != null ? Convert.ToInt32(DropDownList.SelectedItem.Value) : int.MinValue;
                
        }
    }
}
